package file.gui;

import java.awt.ScrollPane;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;


public class GUI_ImageLabelTest extends JFrame {
	
	GUI_ImageLabelTest(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setTitle("test");
		setSize(800, 600);
		
		GUI_ImageLabel label1 = new GUI_ImageLabel(new ImageIcon("001.jpg"),getWidth());
//		GUI_ImageLabel label2 = new GUI_ImageLabel(new ImageIcon("test.jpg"),getWidth());
		JPanel panel = new JPanel();
		panel.add(label1);
//		panel.add(label2);
//		panel.setSize(label1.getSize());
		JScrollPane scrollpanel = new JScrollPane(panel);
		System.out.println(panel.getSize());
		scrollpanel.getVerticalScrollBar().setUnitIncrement(30);
		scrollpanel.getVerticalScrollBar().setBlockIncrement(30);
		scrollpanel.getHorizontalScrollBar().setBlockIncrement(30);
		scrollpanel.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
		add(scrollpanel);
		
		setLocationRelativeTo(null);
		setVisible(true);
	}
	
	public static void main(String[] args) {
		new GUI_ImageLabelTest();
	}
}
